var MaterialManager = Class.extend({
	init: function() {
		this.materialRegistry = [];
	},
	
	registerMaterial: function(context, materialName, shaderName, textureName) {
		var shader = context.shaderManager.getShader(shaderName);
		var texture = context.textureManager.getTexture(textureName);
		var material = new Material(context, shader, texture);
		this.materialRegistry[materialName] = material;
	},
	
	getMaterial: function(materialName) {
		var material = this.materialRegistry[materialName];
		if (!material) {
			throw new Error("Undefined material: " + materialName);
		}
		return material;
	},
}); 
